<template>
    <rui-page :defines="defines">
        <Row>
            <rui-query :label-width="120"
                       :query="queryBatchStepLogInfo"
                       :query-rows="queryRows"
                       ref="logQuery"
            />
        </Row>
        <rui-table :defineId="'batchStepLog'"
                   :fixedLeft="['systemName','batchNo','batchName']"
                   :fixedRight="['stepStatus']"
                   :showIndex="false"
                   :select="false"
                   @loadDatas="queryBatchStepLogInfo"
                   ref-query="logQuery"
                   ref="batchStepLogInfoTable">
        </rui-table>
    </rui-page>
</template>

<script>
import {queryStepLogs} from '_p/basic/api/batch/batchInfo'
import batchStepLog from './defines/batch-group-log-define'
export default {
    name: "batch-job-step-logs",
    data() {
        return {
            defines:[{
                id:'batchStepLog',
                fields:batchStepLog
            }],
            queryRows: [
                {
                    defineId: 'batchStepLog',
                    totalSpan: 12,
                    fields: ['systemName', 'batchNo']
                },
                {
                    defineId: 'batchStepLog',
                    totalSpan: 12,
                    fields: ['batchDate', 'stepStatus']
                }
            ]
        };
    },
    methods: {
        queryBatchStepLogInfo(queryData) {
            queryStepLogs(queryData).then(res=>{
                if (res.code === "0000") {
                    let {records, total} = res.data;
                    this.$refs.batchStepLogInfoTable.updateTableData(records, total);
                }
            });
        }
    },
    computed: {

    },
    created(){

    },
    mounted() {
        this.$refs['batchStepLogInfoTable'].reloadData();
    }
};
</script>
